package src.main.StructuralPatterns.Adapter.Class;

public class DatabaseAdapter extends LegacyDatabase implements NewDatabase {
    @Override
    public void connect(String url) {
        // 解析新URL格式（如"jdbc:mysql://localhost:3306"）
        String[] parts = url.split(":");
        super.legacyConnect(parts[2], Integer.parseInt(parts[3]));
    }

    @Override
    public void execute(String sql) {
        super.legacyExecute("转换SQL: " + sql.toLowerCase());
    }
}
